package com.patternsbox.creational.factorymethod;

import com.patternsbox.ActionTemplate;

public class FactoryMethodAction extends ActionTemplate {

	@Override
	protected void doAction() {
		// An array of creators
		Creator[] creators = new Creator[2];
		creators[0] = new ConcreteCreatorA();
		creators[1] = new ConcreteCreatorB();
		// Iterate over creators and create products

		for (Creator creator : creators) {
			Product product = creator.factoryMethod();
			System.out.println("Created product: "
					+ product.getClass().getSimpleName());
		}
	}

}
